<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <button onclick="send()">fetch send()</button>

    <script>
      function send() {
        fetch("http://localhost:8080/mvc/hello", {
          method: "post",
          body: "id=1&name=zs",
        })
          .then(function (response) {
            // response是一个对象 xhr.response
            return response.text();
          })
          .then(function (data) {
            console.log(data);
          });
      }
    </script>
  </body>
</html>
